<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
  <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  <title>title</title>
  <link rel="stylesheet" type="text/css" href="../../css/api.css" />
  <link rel="stylesheet" type="text/css" href="../../css/mycss.css" />
  <link rel="stylesheet" type="text/css" href="../../css/news.css" />
  <link rel="stylesheet" type="text/css" href="../../css/frame3.css" />
  <style>
    body {
      margin: 0;
    }

    .lab {
      padding: 10px 14px;
      font-size: 12px;
    }

    .lists {
      padding: 10px;
      display: flex;
      align-items: center;
      background-color: #fff;
    }

    .item {
      width: 29%;
      text-align: center;
      font-size: 12px;
      padding: 8px 0;
      background-color: rgb(233, 233, 233);
      border-radius: 14px;
      margin-left: 3.25%;
      margin-bottom: 8px;
      color: #666;
    }

    .item.active {
      background: linear-gradient(to right, rgb(121, 90, 205), rgb(172, 90, 205));
      color: #fff;
    }
    .input{
      line-height: 35px;
      height: 35px;
      width: 100%;
      margin: 10px 10px;
      border-radius: 10px;
      padding-left: 10px;
      border: 1px solid #eee;
    }
    .title{
      width: 150px;
    }
    .info{
      padding: 30px;
      text-align: center;
      color: #1e83d3;
    }

  </style>
</head>

<body>
<div id="view" v-cloak>
  <div class="lists">
    <div class="title">微信号：</div>
    <input class="input" type="text" v-model="data.wxcount"   :placeholder="_i18n('输入微信号')">
  </div>
<!--  <div class="lists" @click="setLevel()">-->
<!--    <div class="title">解锁金额：</div>-->
<!--     <input class="input" type="text" placeholder="请选择>" readonly :value="(data.line_price == 0 || data.line_price == '0.00') ? '免费' : data.line_price">-->
<!--  </div>-->
  <!-- <div class="info" onclick="_url({url:'frame3/level_desc', title:_i18n('亲密度等级说明')})">
    亲密度等级说明》
  </div> -->
  <div class="new-submit"  @click="sub()">
    提交
  </div>
</div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/jquery.js"></script>
<script type="text/javascript" src="../../script/ffkj.js"></script>
<script type="text/javascript" src="../../script/vue.js"></script>
<script type="text/javascript" src="../../script/select_json.js"></script>
<script type="text/javascript">
  var view = new Vue({
    el: '#view',
    data: {
      data: {
        wxcount: '',
        line_price: ''
      },
      unblock_wechat: '',
      nowLevel: {
        id: 0,
        name: '请选择'
      },

      levels: []
    },
    methods: {
      setLevel(){
        let app = this;
        openUIActionSelector(  this.levels, {
          col: 1,
          title: '设置解锁金额'
        }, function (ret, err) {
          if(ret.eventType === 'ok'){
            console.log(JSON.stringify(ret))
            app.data.line_price = ret.selectedInfo[0].val
          }
        })
      },

      sub(){
        _loading();
        _ajax('api/proxy/bdwechat', function(ret, err) {
          _loadingClose();
          var msg = ret.code == 200 ? '提交成功' : ret.msg;
          _msg(msg);
          if (ret && ret.code == 200) {
            timerWin();
          }
        }, {
          user_id: this.data.id,
          wxcount: this.data.wxcount,
          wxname: this.data.wxcount
        });
      }
    }
  })
  apiready = function() {
    getUserInfo();
  }

  // 获取个人资料
  function getUserInfo() {
    _getUser(function(ret) {
      view.data = ret.result;
      // getLevel();
    })
  }
  function getLevel(){
    _ajax('api/member/config', function(ret, err) {
      if(ret, ret.data){
        view.unblock_wechat = ret.data.unblock_wechat || ''
      }
    }, {
      user_id: $api.getStorage('userid')
    });
  }

</script>

</html>